<!--资源调查-->
<template>
  <div class="tariff-verification-box pending-task">
    <el-form
        ref="TcForm2"
        label-position="left"
        label-width="1.5rem"
        :model="Form"
    >
      <h2 class="ne-title-v2">需求单：资源调查</h2>
      <el-row>
        <tc-form2 :form="Form"  :star-index=0 :end-index=16>
        </tc-form2>
      </el-row>
      <h2 class="ne-title-v2">现场资源勘查情况</h2>
      <el-row>
        <tc-form2 :form="Form"  :star-index=16 :end-index=27>
        </tc-form2>
      </el-row>
      <h2 class="ne-title-v2">维护等级</h2>
      <el-row>
        <tc-form2 :form="Form"  :star-index=27 :end-index=29>
        </tc-form2>
      </el-row>
      <h2 class="ne-title-v2">当地用户信息确认</h2>
      <el-row>
        <tc-form2 :form="Form"  :star-index=29 :end-index=48>
        </tc-form2>
        <el-col :span="24" class="text-center">
          <el-button type="primary" size="medium" @click="submitFun">保存</el-button>
          <el-button size="medium" @click="closeFun">取消</el-button>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>
<script>
import TcForm2 from "@/components/public/TcForm2";
import requestUtil from '@/utils/requestEnc';
import CustOrderService from "@/api/order/CustOrderService";
import { mapState } from "vuex";
import custOrderDetail from '@/mixins/custorder/custOrderDetail';
export default {
  name: "TariffVerification",
  mixins: [custOrderDetail],
  data() {
    return {
      Form: {
        "22746-141000044": {
          type: 'Ipt',
          name: '节点名称',
          fieldId: "NODE_NAME",
          tableName: "ORDER_TASK",
          colId: "NODE_NAME",
          colType: "C",
          value: "",
          attrRoleCd: "0",
          id: "22746-141000044",
          readOnly:true,
          show: true,
          span: 6
        },
        "22746-100013696": {
          name: '接入方式',
          type: 'select',
          attrRoleCd: "0",
          colId: "100013696",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "INPUT_MODE",
          value: "",
          id: "22746-100013696",
          options: [{label: '实线接入', value: '80050060002'}, {label: '光纤接入', value: '80050060003'}, {
            label: '其他接入',
            value: '80050060004'
          }],
          required: true,
          show: true,
          span: 6,
        },
        "22746-100013697": {
          name: '接入类别',
          type: 'select',
          attrRoleCd: "0",
          colId: "100013697",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "SOURCE_INPUT_TYPE",
          value: "",
          id: "22746-100013697",
          options: [{label: 'DDN', value: '0907130001'}, {label: 'ATM', value: '0907130002'}, {
            label: 'FR',
            value: '0907130003'
          }, {label: 'SDH', value: '0907130004'}, {label: '以太网', value: '0907130005'}, {
            label: 'MSTP',
            value: '0907130006'
          }],
          required: false,
          show: true,
          span: 6,
          marginRight:'25%'
        },
        "22746-100012584": {
          name: '端口来源',
          type: 'select',
          attrRoleCd: "0",
          colId: "100012584",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "PORT_SOURCE",
          value: "",
          id: "22746-100012584",
          options: [{label: '新开端口', value: '80060008001'}, {label: '原有端口', value: '80060008002'}],
          required: false,
          show: true,
          span: 6,
        },
        "22746-100012344": {
          type: 'Ipt',
          name: '局向',
          attrRoleCd: "0",
          colId: "100012344",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "SOURCE_DIRECT",
          value: "",
          id: "22746-100012344",
          show: true,
          span: 6,
        },
        "22746-100012918": {
          type: 'Ipt',
          name: '汇聚点空余汇聚能力',
          fieldId: "COLLECT_REMAIN",
          tableName: "ORDER_TASK_ATTR",
          colId: "100012918",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22746-100012918",
          show: true,
          span: 6
        },
        "22746-100012871": {
          name: '是否需租用第三方资源',
          type: 'select',
          attrRoleCd: "0",
          colId: "100012871",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "THR_RES_FLAG",
          value: "",
          id: "22746-100012871",
          options: [{label: '是', value: '1'}, {label: '否', value: '0'}],
          required: false,
          show: true,
          span: 6,
          marginRight:'75%'
        },
        "22746-141000170": {
          type: 'Ipt',
          name: '可支持MTU数值',
          fieldId: "MTUNUM",
          tableName: "ORDER_TASK_ATTR",
          colId: "141000170",
          colType: "T",
          value: "北京本地网",
          attrRoleCd: "0",
          id: "22746-141000170",
          readOnly:true,
          show: true,
          span: 6
        },
        "22746-141000168": {
          name: 'MTU数值情况',
          type: 'select',
          attrRoleCd: "0",
          colId: "141000168",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "INPUT_MODE",
          value: "",
          id: "22746-141000168",
          options: [{label: '支持', value: '10803002'}, {label: '不支持', value: '10803001'}],
          required: true,
          show: true,
          span: 6,
        },
        "22746-141000169": {
          name: 'QINQ情况',
          type: 'select',
          attrRoleCd: "0",
          colId: "141000169",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "QINQCASE",
          value: "",
          id: "22746-141000169",
          options: [{label: '不支持', value: '10803002'}, {label: '支持', value: '10803001'}],
          required: false,
          show: true,
          span: 6,
          marginRight:'25%'
        },
        "22746-100013700": {
          name: '接入局上联中继资源',
          type: 'select',
          attrRoleCd: "0",
          colId: "100013700",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "TRUNKRESOURCE",
          value: "9005001",
          id: "22746-100013700",
          options: [{label: '具备', value: '9005001'}, {label: '不具备', value: '9005002'}],
          required: true,
          show: true,
          span: 6,
        },
        "22746-100013704": {
          type: 'date',
          name: '预计工期(工作日)',
          fieldId: "TRUNKDATE",
          tableName: "ORDER_TASK_ATTR",
          colId: "100013704",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22746-100013704",
          readOnly:true,
          show: true,
          span: 6
        },
        "22746-100013708": {
          type: 'textarea',
          name: '备注',
          fieldId: "TRUNKNOTE",
          tableName: "ORDER_TASK_ATTR",
          colId: "100013708",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22746-100013708",
          readOnly:true,
          show: true,
          span: 6,
          marginRight:'25%'
        },
        "22746-100013701": {
          name: '接入局设备资源(含端口)',
          type: 'select',
          attrRoleCd: "0",
          colId: "100013701",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "DEVICERESOURCE",
          value: "9005001",
          id: "22746-100013701",
          options: [{label: '具备', value: '9005001'}, {label: '不具备', value: '9005002'}],
          required: true,
          show: true,
          span: 6,
        },
        "22746-100013705": {
          type: 'date',
          name: '预计工期(工作日)',
          fieldId: "DEVICEDATE",
          tableName: "ORDER_TASK_ATTR",
          colId: "100013705",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22746-100013705",
          readOnly:true,
          show: true,
          span: 6
        },
        "22746-100013709": {
          type: 'textarea',
          name: '备注',
          fieldId: "DEVICENOTE",
          tableName: "ORDER_TASK_ATTR",
          colId: "100013709",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22746-100013709",
          readOnly:true,
          show: true,
          span: 6,
          marginRight:'25%'
        },
        "22755-100013702": {
          name: '外线资源',
          type: 'select',
          attrRoleCd: "0",
          colId: "100013702",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "OUTSIDERESOURCE",
          value: "9005001",
          id: "22755-100013702",
          options: [{label: '具备', value: '9005001'}, {label: '不具备', value: '9005002'}],
          required: true,
          show: true,
          span: 6,
        },
        "22755-100013706": {
          type: 'date',
          name: '预计工期(工作日)',
          fieldId: "OUTSIDEDATE",
          tableName: "ORDER_TASK_ATTR",
          colId: "100013706",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22755-100013706",
          readOnly:true,
          show: true,
          span: 6
        },
        "22755-100013710": {
          type: 'textarea',
          name: '备注',
          fieldId: "OUTSIDENOTE",
          tableName: "ORDER_TASK_ATTR",
          colId: "100013710",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22755-100013710",
          readOnly:true,
          show: true,
          span: 6,
          marginRight:'25%'
        },
        "22755-100013703": {
          name: '客户端电信设备资源(含端口)',
          type: 'select',
          attrRoleCd: "0",
          colId: "100013703",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "TELEDEVICERESOURCE",
          value: "9005001",
          id: "22755-100013703",
          options: [{label: '具备', value: '9005001'}, {label: '不具备', value: '9005002'}],
          required: true,
          show: true,
          span: 6,
        },
        "22755-100013707": {
          type: 'date',
          name: '预计工期(工作日)',
          fieldId: "TELDEVICEDATE",
          tableName: "ORDER_TASK_ATTR",
          colId: "100013707",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22755-100013707",
          readOnly:true,
          show: true,
          span: 6
        },
        "22755-100013711": {
          type: 'textarea',
          name: '备注',
          fieldId: "TELTRUNKNOTE",
          tableName: "ORDER_TASK_ATTR",
          colId: "100013711",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22755-100013711",
          readOnly:true,
          show: true,
          span: 6,
          marginRight:'25%'
        },
        "22755-100012535": {
          name: '客户楼内线',
          type: 'select',
          attrRoleCd: "0",
          colId: "100012535",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "IS_FLOOR_PAINT",
          value: "9005001",
          id: "22755-100012535",
          options: [{label: '具备', value: '9005001'}, {label: '不具备', value: '9005002'}],
          required: true,
          show: true,
          span: 6,
        },
        "22755-100012667": {
          type: 'Ipt',
          name: '客户楼内线描述',
          fieldId: "FLOOR_PAINT_TEXT",
          tableName: "ORDER_TASK_ATTR",
          colId: "100012667",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22755-100012667",
          readOnly:true,
          show: true,
          span: 6,
          marginRight: '50%'
        },
        "22746-100012466": {
          type: 'Ipt',
          name: '设备产商',
          fieldId: "DEV_FACTORY",
          tableName: "PROD_INST_ATTR",
          colId: "100012466",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22746-100012466",
          readOnly:true,
          show: true,
          span: 6,
        },
        "22746-100013577": {
          type: 'Ipt',
          name: '设备型号',
          fieldId: "DEVICE_TYPE",
          tableName: "PROD_INST_ATTR",
          colId: "100013577",
          colType: "T",
          value: "北京本地网",
          attrRoleCd: "0",
          id: "22746-100013577",
          readOnly:true,
          show: true,
          span: 6,
        },
        "22746-100012654": {
          type: 'Ipt',
          name: '主控板软件版本',
          fieldId: "SOFT_VERSION",
          tableName: "PROD_INST_ATTR",
          colId: "100012654",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22746-100012654",
          readOnly:true,
          show: true,
          span: 6,
          marginRight: '25%'
        },
        "22747-100012783": {
          name: '电路维护等级是否具备',
          type: 'select',
          attrRoleCd: "0",
          colId: "100012783",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "LEVEL_MIAN_FLAG",
          value: "9005001",
          id: "22747-100012783",
          options: [{label: '具备', value: '9005001'}, {label: '不具备', value: '9005002'}],
          required: true,
          show: true,
          span: 6,
        },
        "22747-100012749": {
          name: '可提供电路维护等级',
          type: 'select',
          attrRoleCd: "0",
          colId: "100012749",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "LEVEL_MIAN_PRO",
          value: "9005001",
          id: "22747-100012749",
          options: [{label: 'AAA级', value: '80050036001'}, {label: 'AA级', value: '80050036002'},
            {label: 'A级', value: '80050036003'},
            {label: 'I级', value: '80050036004'},
            {label: 'II级', value: '80050036005'},
            {label: 'III级', value: '80050036006'},
            {label: '普通', value: '80050036007'}],
          required: true,
          show: true,
          span: 6,
          marginRight:'50%'
        },
        "22756-142002249": {
          name: '当地客户联系人确认',
          type: 'select',
          attrRoleCd: "0",
          colId: "142002249",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "AFFIRM",
          value: "",
          id: "22756-142002249",
          options: [{label: '正确', value: '13264001'}, {label: '错误', value: '13264002'}],
          required: true,
          show: true,
          span: 6,
        },
        "22756-142002250": {
          type: 'Ipt',
          name: '当地客户联系人姓名',
          fieldId: "DDNAM",
          tableName: "ORDER_TASK_ATTR",
          colId: "142002250",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22756-142002250",
          readOnly:true,
          show: true,
          span: 6
        },
        "22756-142002251": {
          type: 'Ipt',
          name: '当地客户联系人电话',
          fieldId: "DDNUM",
          tableName: "ORDER_TASK_ATTR",
          colId: "142002251",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22756-142002251",
          readOnly:true,
          show: true,
          span: 6,
          marginRight: '25%'
        },
        "22756-142002253": {
          name: '客户机房是否具备开通调测条件',
          type: 'select',
          attrRoleCd: "0",
          colId: "142002253",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "KHYESNO",
          value: "",
          id: "22756-142002253",
          options: [{label: '是', value: '1'}, {label: '否', value: '2'}],
          required: true,
          show: true,
          span: 6,
        },
        "22756-142002254": {
          type: 'Ipt',
          name: '如机房不具备开通条件预计何时可以具备',
          fieldId: "YJHSJB",
          tableName: "ORDER_TASK_ATTR",
          colId: "142002254",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22756-142002254",
          readOnly:true,
          show: true,
          span: 6,
          marginRight: '50%'
        },
        "22756-142002252": {
          name: '当地用户是否知道此需求',
          type: 'select',
          attrRoleCd: "0",
          colId: "142002252",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "DDNAMEYESNO",
          value: "",
          id: "22756-142002252",
          options: [{label: '是', value: '1'}, {label: '否', value: '2'}],
          required: true,
          show: true,
          span: 6,
          marginRight: '75%'
        },
        "22746-100013713": {
          name: '市政问题',
          type: 'select',
          attrRoleCd: "0",
          colId: "100013713",
          colType: "T",
          tableName: "ORDER_TASK_ATTR",
          fieldId: "CITY_PROBLEM",
          value: "",
          id: "22746-100013713",
          options: [{label: '有', value: '30380001'}, {label: '没有', value: '30380002'}],
          required: true,
          show: true,
          span: 6,
        },
        "22746-100014235": {
          name: '是否提供路由图',
          type: 'select',
          attrRoleCd: "0",
          colId: "100014235",
          colType: "T",
          tableName: "PROD_INST_ATTR",
          fieldId: "ROUTE_FLAG",
          value: '2',
          id: "22746-100014235",
          options: [{label: '是', value: '1'}, {label: '否', value: '2'}],
          required: false,
          show: true,
          span: 6,
        },
        "6491-141000141": {
          name: '上传电路图',
          type: 'upload',
          value: [],
          id: "6491-141000141",
          required: false,
          show: true,
          span: 12,
          // marginRight: '25%'
        },
        "22746-141000051": {
          name: '资源情况',
          type: 'select',
          attrRoleCd: "0",
          colId: "RESULT",
          colType: "C",
          tableName: "ORDER_TASK",
          fieldId: "RESULT",
          value: "",
          id: "22746-141000051",
          options: [{label: '具备', value: '9005001'}, {label: '不具备', value: '9005002'}],
          required: true,
          show: true,
          span: 6,
        },
        "22746-100013712": {
          type: 'date',
          name: '总预计工期（工作日）',
          fieldId: "TOTALDATE",
          tableName: "ORDER_TASK_ATTR",
          colId: "100013712",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22746-100013712",
          readOnly:true,
          show: true,
          span: 6,
          marginRight:'50%'
        },
        "22746-142002255": {
          type: 'Ipt',
          name: '客户侧预计工期',
          fieldId: "KHCYJGQ",
          tableName: "ORDER_TASK_ATTR",
          colId: "142002255",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22746-142002255",
          readOnly:true,
          show: true,
          span: 6,
          marginRight:'75%'
        },
        "22746-142002257": {
          type: 'textarea',
          name: '本地客户开通条件总结说明',
          fieldId: "DXZYZJSM",
          tableName: "ORDER_TASK_ATTR",
          colId: "142002257",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22746-142002257",
          readOnly:true,
          show: true,
          span: 20,
          marginRight:'25%'
        },
        "22746-142002256": {
          type: 'textarea',
          name: '本地电信资源情况总结说明',
          fieldId: "DXZYZJSM",
          tableName: "ORDER_TASK_ATTR",
          colId: "142002257",
          colType: "T",
          value: "",
          attrRoleCd: "0",
          id: "22746-142002256",
          readOnly:true,
          show: true,
          span: 20,
          marginRight:'25%'
        },
        "22746-100012611": {
          type: 'date',
          name: '填报期限',
          fieldId: "TASK_REQ_DATE",
          tableName: "ORDER_TASK",
          colId: "TASK_REQ_DATE",
          colType: "C",
          value:"",
          attrRoleCd: "0",
          id: "22746-100012611",
          readOnly:true,
          show: true,
          span: 6,
        },
        "22746-100012440": {
          type: 'date',
          name: '填报日期',
          fieldId: "TASK_OPR_DATE",
          tableName: "ORDER_TASK",
          colId: "TASK_OPR_DATE",
          colType: "C",
          value: "",
          attrRoleCd: "0",
          id: "22746-100012440",
          readOnly:true,
          show: true,
          span: 6,
        },
        "22746-100012377": {
          type: 'Ipt',
          name: '填报人',
          fieldId: "USER_NAME",
          tableName: "ORDER_TASK",
          colId: "USER_NAME",
          colType: "C",
          value: "",
          attrRoleCd: "0",
          id: "22746-100012377",
          readOnly:true,
          show: true,
          span: 6,
        },
        "22746-141000045": {
          type: 'Ipt',
          name: '联系电话',
          fieldId: "LINK_TEL",
          tableName: "ORDER_TASK",
          colId: "LINK_TEL",
          colType: "C",
          value: "",
          attrRoleCd: "0",
          id: "22746-141000045",
          readOnly:true,
          show: true,
          span: 6,
        },
        "22746-100012629": {
          type: 'textarea',
          name: '备注',
          fieldId: "TASK_COMMENT",
          tableName: "ORDER_TASK",
          colId: "TASK_COMMENT",
          colType: "C",
          value: "",
          attrRoleCd: "0",
          id: "22746-100012629",
          readOnly:true,
          show: true,
          span: 20,
          marginRight:'25%'
        }
      },
      odtals:null
    }
  },
  props: {
    ODKInfo: {
      type: Object
    },
    CTOInfo: {
      type: [Object,Array]
    }
  },
  computed: {
    ...mapState('orders',['orderPosInfo']),
    ...mapState('user',['user'])
  },
  mounted() {
  },
  created() {
    // this.submitFun();
    this.getCustomerOrderDetail(this.Form,this.CTOInfo,this.ODKInfo);
    debugger;
    this.Form['22746-100012377'].value=this.user.staffName;
    this.Form['22746-100012440'].value=this.$util.dateFormat(new Date(), "yyyy-MM-dd");   
    this.Form['22746-100012611'].value=this.$util.dateFormat(new Date(), "yyyy-MM-dd");   
  },
  components: {
    TcForm2
  },
  methods: {
    async submitFun(){
      let base={
        userName: this.user.staffName,
        userId: this.user.staffId,
        orgId: this.user.orgId,
        actType: 'MOD',
        oneOrmany:'one'
      };
      let {userId,orgId} = base,
          {custId,orderItemSeqs,custSoNumber,orderItemIds,orderItemId} = this.CTOInfo,
          {orderAuditId,taskId,activityId,processInstId} = this.ODKInfo;
      let param = requestUtil.paramEnc(this.Form,Object.assign(this.ODKInfo,this.CTOInfo,base,this.odtals));
      let allParam = {orderAuditId,orderItemIds,custId,activityId,processInstId,orderItemSeqs,custSoNumber,orderItemId,userId,orgId,taskId,...base,...param};
      const result = await CustOrderService.saveResourceVerification(allParam);
      try {
        if(result.meta.resultCode == 0){
          this.$message({
            type: 'success',
            message: '保存成功!'
          });
          this.$emit('update:show',false);
        }else{
          this.$message({
            showClose: true,
            message: result.meta.resultMsg,
            type: 'error'
          });
        }
      } catch {
        this.$message({
          showClose: true,
          message: 'code:'+result.code+'  msg:'+result.msg,
          type: 'error'
        });
      }
    },
    closeFun(){
      this.$emit('update:show',false)
    }
  }
}
</script>

<style lang="scss" scoped>
.tariff-verification-box{
  height: 84vh;
  overflow-y: auto;
}
</style>

